#pragma once

/******* TODO ***********
Create a buffer for sprite to be cashed after rotation and other operations
to speed up blitting
*************************/

#include <allegro.h>
#include "Common.h"
#include "Config.h"
#include "Tracer.h"

class Sprite
{
public:
	Sprite(void);
	Sprite(BITMAP *_src, BITMAP *_dest, signed int _x=0, signed int _y=0, unsigned int _width=0, unsigned int _height=0, bool _alphaBlended = false);

	virtual ~Sprite(void);

	signed int x;
	signed int y;
	unsigned int width;
	unsigned int height;
	bool visible;
	bool alphaBlended;

	BITMAP *src;
	BITMAP *dest;

	// In radians
	double getRotation() { return (PI * rotation / 128) ; };
	void setRotation(double r){	rotation = radToBin(r);	};

	virtual void draw();

protected:
	double rotation;
};
